//
//  GROderListHeaderView.m
//  YC_GRice
//
//  Created by luojinrong11 on 2018/7/21.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GROderListHeaderView.h"

@implementation GROderListHeaderView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(void)setListModel:(GROrderListModel *)listModel{
    _listModel = listModel;
    self.timeLabel.text = listModel.createdAtStr;
    UIColor * statusTextColor = HEXCOLOR(0x222222);
    NSString * stausStr;
    switch (listModel.status) {
        case 0:
            stausStr = @"订单分析";
            break;
        case 1:
            stausStr = @"未付款";
            break;
        case 3:
            stausStr = @"待发货";
            break;
        case 5:
            stausStr = @"待收货";
            break;
        case 9:{
            stausStr = @"已完成";
            statusTextColor = HEXCOLOR(0x999999);
        }
            break;
        case 10:{
            stausStr = @"已取消";
            statusTextColor = HEXCOLOR(0x999999);
        }
            break;
            
        default:
            stausStr = @"未知订单";
            break;
    }
    [self.stausBt setTitleColor:statusTextColor forState:UIControlStateNormal];
    [self.stausBt  setTitle:stausStr forState:UIControlStateNormal];
   
}

@end
